<include file="Public/common" />
<block name="content">
    <style>
        th,td{text-align: center;}
        .row-2{
            padding: 0px 10px;
        }

        .row-input-width{
            width: 347px!important;
        }
        .form-group{
            padding-right: 50px!important;
            width: 42%!important;
            margin-bottom: 15px!important;
        }

        .orderNo-item{
            padding-left: 28px;
        }
        .bill-time-item{
            padding-left: 14px;
        }
        .margin-left-29{
            margin-left: 29px;
        }
        .range-item{
            padding: 7px 10px;
            background-color: #eee;
        }

        .input-left{
            margin-left: -4px;
        }
        .select-btn{
            margin-top: -15px;
        }
        .total-item{
            text-align: right;
            padding: 0 3px 10px 3px;
            color: red;
        }
        ul{ padding: 0; }
    </style>
    <div class="page-header"><h1><i class="fa fa-home"></i> 首页 &gt; 财务管理 &gt; 员工销售业绩</h1></div>

    <div class="col-xs-12">

        <div class="tab-content">
            <div class="row" >
                <form action="" id="form" class="form-inline" style="margin-left:10px;" >
                    <input type="hidden" name="p" value="1" />
                    <div class="row-2" >
                        <div class="form-group">
                            <label for="start_time" class="bill-time-item">下单日期:</label>
                            <input type="text" name="start_time" id="start" value="<if condition="$_GET['start_time']">{$_GET['start_time']}</if>">
                            <span class="range-item input-left">至</span>
                            <input class="input-left" type="text" name="end_time" id="end" value="<if condition="$_GET['end_time']">{$_GET['end_time']}</if>">
                        </div>
                     </div>
                    <div class="row-2" >
                        <div class="form-group">
                            <label for="source_type" class="bill-time-item margin-left-29">门店:</label>
                            <select id="shop_id" name="shop_id" class="row-input-width">
                                <option value="">请选择</option>
                                <volist name="shop" id="vo">
                                    <option value='{$vo['reseller_id']}' <if condition="$_GET['shop_id'] == $vo['reseller_id'] ">selected</if>>{$vo['reseller_name']}</option>
                                </volist>
                            </select>
                        </div>
                        <div class="form-group">
                            <label for="sales">销售人员:</label>
                            <input type="text" name="sales" value="<if condition="$_GET['sales']">{:urldecode($_GET['sales'])}</if>" placeholder="请输入销售人员名称" />
                        </div>
                    </div>
                    <div class="col-xs-12" >
                        <button type="submit" class="btn btn-primary ">查询</button>
                        <button type="button" class="btn btn-primary" onclick="outExcel()">导出</button>
                    </div>
                </form>
            </div>
        </div>

        <div class="tabbable">
  <!--           <ul class="nav nav-tabs padding-12 tab-color-blue background-blue" id="myTab">
                <li class="active"><a href="{:U('Rule/admin_user_list')}">员工列表</a></li>
                <li><a href="{:U('Rule/add_admin')}">添加员工</a></li>
            </ul> -->
            <div class="tab-content">
                <div class="total-item">总销售额：¥{$all_total_money}</div>
                <table class="table table-striped table-bordered table-hover table-condensed">
                    <tr>
                        <th>订单号</th>
                        <th>线路名称</th>
                        <th>下单日期</th>
                        <th>订单总额</th>
                        <th>销售人员</th>
                    </tr>
                    <foreach name="list" item="v">
                        <tr>
                            <td>{$v['order_num']}</td>
                            <td>{$v['line_name']}</td>
                            <td>{$v['create_time']|date='Y-m-d',###}</td>
                            <td>{$v['total_money']}</td>
                            <td>{$v['name']}</td>
                        </tr>
                    </foreach>
                    <tr>
                        <td colspan="7">
                            <!--分页样式-->
                            <ul class="pagination">
                                {$show}
                            </ul>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
<script src="__JS__/jedate/jedate.js"></script>
<script>
//导出excel
    function outExcel(){
        $form = $('#form');
        $form.attr('action', '{:U('outPerformanceExcel')}');
        $form.submit();
        $form.attr('action', '');
    }
    /**
     * 绑定日期选择器
     * @param  {[obj]}    obj        [元素]
     * @param  {[string]} dateFormat [时间格式]
     */
    function dateFormat(obj, dateFormat){
        jeDate({
            dateCell: '#'+$(obj).attr('id'),
            format: dateFormat,
            isinitVal:false,
            isTime:true, //isClear:false,
            okfun:function(val){
            }
        });
    }
   dateFormat($('#start'), 'YYYY-MM-DD');
   dateFormat($('#end'), 'YYYY-MM-DD');
</script>
</block>
